home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / pc_board / pcbss20.zip / XFER.DEF < prev   
Text File  |  1991-10-11  |  5KB  |  124 lines

  1. ;
  2. ; File xfer script for PCBSuperScript
  3. ;
  4.   FIELDS
  5.     Op        .                             C
  6.     Name      ............                  C
  7.     Directory .........................     C
  8.     XferFile  ............................................     C
  9.     DszLog    ..............................................................  C
  10.     DszShell  ..............................................................  C
  11.     DszRShell ..............................................................  C
  12.     DszSShell ..............................................................  C
  13.     FileData  ..............................................................  C
  14.     FMask     ..............................................................  C
  15.   FIELDS
  16.  
  17.   BEEPS OFF                               ;turn beeps off
  18.   PARSE @%PCBDOOR
  19.   GETWORD Op
  20.   IF Op == "*EOL*"
  21.     SET Op
  22.     GOTO NxtFile
  23.   ENDIF
  24.  
  25.   GETWORD Directory
  26.   IF Directory == "*EOL*"
  27.     SET Directory
  28.     GOTO NxtFile
  29.   ENDIF
  30.  
  31.   GETWORD Name
  32.   IF Name == "*EOL*"
  33.     SET Name
  34.     GOTO NxtFile
  35.   ENDIF
  36.   GOTO JumpIn
  37.  
  38. :NxtFile
  39.   NEWLINE
  40.   NEWLINE
  41.   SET Op                                  ;set var "Op" to null
  42.   COLOR BRIGHT WHITE BLACK                ;set crt color
  43.   PROMPT "Upload, Download or Quit: " Op  ;prompt user for option
  44.   UCASE Op                                ;force "Op" to upper case
  45.   SWITCH  Op                              ;test var "Op"
  46.     CASE  "Q"                             ;quit
  47.       GOTO AbortJob                       ; exit script
  48.       BREAK                               ;
  49.     CASE  "U"                             ;upload
  50.       BREAK                               ;
  51.     CASE  "D"                             ;download
  52.       BREAK                               ;
  53.     CASE                                  ;default processing
  54.       TEXT "Invalid option - try again"   ;display msg to user
  55.       GOTO NxtFile TOP                    ;get option
  56.       BREAK                               ;
  57.   SWITCH  END                             ;
  58.  
  59.   PROMPT "             File Name: " Name        ;get file name
  60.   NULL_ENTRY  NxtFile                           ;if null, get option
  61.   PROMPT "             Directory: " Directory   ;get dir name
  62.   NULL_ENTRY  NxtFile                           ;if null, get option
  63.  
  64. :JumpIn
  65.   UCASE Name                          ;set "Name" to upper case
  66.   UCASE Directory                     ;set "Directory" to upper case
  67.   SET   XferFile  Directory "\" Name  ;set xfer file name to dir+'\'+name
  68.   IF Op == "D"
  69.     IF "*" !? XferFile                ;is "*" in the file name?
  70.       IF XferFile !EXIST              ;nope - does it exist?
  71.         TEXT "File " XferFile " does not exist."
  72.         GOTO NxtFile                  ;try again...
  73.       ENDIF
  74.     ENDIF
  75.   ENDIF
  76.  
  77.   SET   DszLog    "DSZLOG=" Directory @firstu@ ".log"
  78.   SET   DszRShell " port " @port@ " ha bo z rz -mrr " Directory
  79.   SET   DszSShell " port " @port@ " ha bo z sz " XferFile
  80.  
  81.   IF @graphics@ == "1"            ;not really needed since the following two
  82.     CLEARCRT                      ; commands have 0 effect on no-graphics
  83.     GOTORC 22 1
  84.   ENDIF
  85.  
  86.   ESET  DszLog                    ;set env var for DSZ to log errors
  87.   SHELL "del " @%DSZLOG           ;delete the log file (in case it exist)
  88.  
  89.   COLOR BRIGHT CYAN BLACK         ;set crt color
  90.   NEWLINE                         ;print a blank line
  91.   INDENT  5                       ;
  92.   SWITCH  Op                      ;what option?
  93.     CASE  "D"                     ;download requested..
  94.       SET DszShell DszSShell      ;set shell command value to dsz send
  95.       TEXT "@X08" "----------------------------------------------------------------"
  96.       TEXT "@X1B" "               Prepare to receive file now...                   " "@X00"
  97.       TEXT "@X08" "----------------------------------------------------------------"
  98.       BREAK
  99.     CASE  "U"                     ;upload requested..
  100.       SET DszShell DszRShell      ;set shell command value to dsz recv
  101.       TEXT  "@X08" "----------------------------------------------------------------"
  102.       TEXT  "@X1B" "                   Send the file now...                         " "@X00"
  103.       TEXT  "@X08" "----------------------------------------------------------------"
  104.       BREAK
  105.   SWITCH  END
  106.   INDENT  0
  107.  
  108.   TEXT  DszShell
  109.   SHELL j:\pcb\DSZ.com DszShell   ;do the xfer
  110.  
  111.   IF @%DSZLOG EXIST               ;if the dsz log file exists,
  112.     NEWLINE                       ; print a blank line,
  113.     COLOR BRIGHT RED BLACK        ; set crt color,
  114.     DISPLAY_FILE @%DSZLOG         ; display the DSZ error log file
  115.   ENDIF                           ;
  116.  
  117.   IF @%PCBDOOR != ""
  118.     GOTO AbortJob
  119.   ENDIF
  120.   GOTO NxtFile                    ;get next option
  121.  
  122. :AbortJob
  123.   EXIT
  124.